(defun c:ls-profiles (/ acad proflist)
  (vl-load-com)
  (setq acad (vlax-get-acad-object))
  (vla-getallprofilenames
    (vla-get-profiles (vla-get-preferences acad))
    'proflist
  )
  (textscr)
  (princ "\nAvailable profiles:\n")
  (mapcar '(lambda (x) (princ (strcat x "\n")))
	  (vl-sort (vlax-safearray->list proflist) '<)
  )
  (princ)
)

